<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<html >
<head>
    <meta charset="UTF-8">
    <title>Status - Online Judge</title>
    <link rel="stylesheet" th:href="@{/css/styles.css}" >
    <script th:src="@{/js/jquery-1.7.2.js}"></script>
    <script th:src="@{/js/gdoj.js}"></script>
</head>
<body>
<div th:replace="common::web-navbar"></div>
<div class="container">
    <div class="content">
        <div class="content-no-sidebar">
            <div th:replace="admin/admin-common::admin-navbar"></div>
            <div class="roundbox">
                <table class="status rtable">
                    <tr class="header">
                        <th  class="id left-item">[[#{statusid}]]</th>
                        <th  class="coder">[[#{author}]]</th>
                        <th  class="title" >[[#{problem}]]</th>
                        <th  class="language">[[#{language}]]</th>
                        <th  class="time">[[#{timeuse}]]</th>
                        <th  class="memory">[[#{memoryuse}]]</th>
                        <th  class="verdict">[[#{status}]]</th>
                        <th  class="date">[[#{submitdate}]]</th>
                        <th ></th>
                    </tr>
                    <tr th:if="${pageInfo.size == 0}"><td class="left-item dark" colspan="5" style="text-align: left;">There is no records.</td></tr>
                    <tr th:each="solution,stat : ${pageInfo.list}" th:class="${stat.odd}?'dark'">
                        <td class="id left-item">
                            <a th:solutionId="${solution.solution_id}" class="view-source"  title="source" target="_blank" th:text="${solution.solution_id}"></a>
                        </td>
                        <td class="coder ">
                            <a th:href="@{/profile/{username}(username=${solution.username})}" class="rated-user" th:classappend="'user-rate-' + ${solution.user.rate} + ' user-tip'" th:user="${solution.username}"  th:text="${solution.username}"></a></td>
                        <td class="title">
                            <a th:if="${solution.problem.title != null}" th:href="@{/problemset/problem/{problem_id}(problem_id=${solution.problem_id})}" th:text="${solution.problem_id} + '.' + ${solution.problem.title}"></a>
                            <span th:if="${solution.problem.title == null}" style="color:grey">Problem Invisible</span>
                        </td>
                        <td class="language" th:text="${solution.language_name}"></td>
                        <td class="time" th:id="'time_' + ${solution.solution_id}" th:text="${solution.time} + ' ms'"></td>
                        <td class="memory" th:id="'memory_' + ${solution.solution_id}" th:text="${solution.memory} + ' kb'"></td>
                        <td class="verdict verdict_ce" th:id="'status_' + ${solution.solution_id}" th:status="${solution.verdict}" manual="0" th:if="${solution.verdict==3}" th:text="${solution.status_description}"> </td>
                        <td class="verdict verdict_ac" th:id="'status_' + ${solution.solution_id}" th:status="${solution.verdict}" manual="0" th:if="${solution.verdict==5}" th:text="${solution.status_description}"> </td>
                        <td class="verdict verdict_pe" th:id="'status_' + ${solution.solution_id}" th:status="${solution.verdict}" manual="0" th:if="${solution.verdict==10}" th:text="${solution.status_description}"> </td>
                        <td class="verdict verdict_prev" th:id="'status_' + ${solution.solution_id}" th:status="${solution.verdict}" manual="0" th:if="${solution.verdict == 1 || solution.verdict == 2 || solution.verdict == 4}" th:text="${solution.status_description}"> </td>
                        <td class="verdict verdict_other" th:id="'status_' + ${solution.solution_id}" th:status="${solution.verdict}" manual="0" th:if="${solution.verdict > 5 && solution.verdict !=10 }" th:text="${solution.status_description}"> </td>
                        <td class="date" th:title="${#dates.format(solution.submit_date,'yyyy-MM-dd HH:mm:ss')}" th:text="${solution.friendlySubmitDate}"></td>
                        <td><a th:solutionId="${solution.solution_id}" class="re-judge">re-judge</a></td>
                    </tr>
                </table>
            </div>
            <div style="margin:6px 12px;font-size:15px;">
                <div class="left"></div>
                <div class="right">
                    <a th:if="${pageInfo.hasPreviousPage == true}"
                       th:href="'/admin/problemset' + (${problemId != null}? '/' + ${problemId} : '') +
                       '/status/' + (${username != null}? ${username} + '/' : '') + 'page/' + ${pageInfo.prePage}">&larr;</a>
                    <a th:if="${pageInfo.firstPage > 1}"
                       th:href="'/admin/problemset' + (${problemId != null}? '/' + ${problemId} : '') +
                       '/status/' + (${username != null}? ${username} + '/' : '') + 'page/1'">1</a>
                    <span th:if="${pageInfo.firstPage > 2}"  >...</span>
                    <span th:each="nav:${pageInfo.navigatepageNums}">
                        <a th:href="'/admin/problemset' + (${problemId != null}? '/' + ${problemId} : '') +
                       '/status/' + (${username != null}? ${username}  + '/' : '') + 'page/' + ${nav}"
                           th:text="${nav}" th:styleappend="${nav == pageInfo.pageNum} ? 'font-weight: bold;' : ''"></a>
                    </span>
                    <span th:if="${pageInfo.lastPage < pageInfo.pages}" >...</span>
                    <a th:if="${pageInfo.pages > pageInfo.lastPage}"
                       th:href="'/admin/problemset' + (${problemId != null}? '/' + ${problemId} : '') +
                       '/status/' + (${username != null}? ${username}  + '/' : '') + 'page/' + ${pageInfo.pages}"
                       th:text="${pageInfo.pages}"></a>
                    <a th:if="${pageInfo.hasNextPage == true}"
                       th:href="'/admin/problemset' + (${problemId != null}? '/' + ${problemId} : '') +
                       '/status/' + (${username != null}? ${username}  + '/' : '') + 'page/' + ${pageInfo.nextPage}">&rarr;</a>
                </div>
            </div>
        </div>
    </div>
    <div th:replace="common::web-footer"></div>
    <div th:include="status-pop"></div>
</div>

</body>
</html>
